import java.util.Scanner;
public class test423 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter employee's name: ");
        String name = scanner.nextLine();
        System.out.print("Enter number of hours worked in a week: ");
        double hours = scanner.nextDouble();
        System.out.print("Enter hourly pay rate: ");
        double payRate = scanner.nextDouble();
        System.out.print("Enter federal tax withholding rate: ");
        double federalRate = scanner.nextDouble();
        System.out.print("Enter state tax withholding rate: ");
        double stateRate = scanner.nextDouble();
        double grossPay = hours * payRate;
        double federalWithholding = grossPay * federalRate;
        double stateWithholding = grossPay * stateRate;
        double totalDeduction = federalWithholding + stateWithholding;
        double netPay = grossPay - totalDeduction;
        System.out.println("\nEmployee Name: " + name);
        System.out.printf("Hours Worked: %.1f%n", hours);
        System.out.printf("Pay Rate: $%.2f%n", payRate);
        System.out.printf("Gross Pay: $%.1f%n", grossPay);
        System.out.println("Deductions:");
        System.out.printf("  Federal Withholding (%.0f%%): $%.2f%n", federalRate * 100, federalWithholding);
        System.out.printf("  State Withholding (%.0f%%): $%.2f%n", stateRate * 100, stateWithholding);
        System.out.printf("  Total Deduction: $%.2f%n", totalDeduction);
        System.out.printf("Net Pay: $%.2f%n", netPay);
        scanner.close();
    }
}
